<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
</head>
<body>
	<script type="text/javascript">
	
	
	var arr = [100,2,99,6,45,500,1,48,78];
	
	
	var min = arr[0];
	var max = arr[0];
	
	
	for(i=1; i<arr.length; i++){
		
		if(min<arr[i]){
			min=arr[i];
		}
		if(max>arr[i]){
			max=arr[i];
		}
	}
	
	console.log("最大值"+min);
	
	console.log("最小值"+max);
	</script>
	
</body>
</html>
